package com.base.cn.platform.os.service.manage.user.signin;

import com.base.cn.platform.os.service.FeignAuthConfig;
import com.base.cn.platform.os.service.manage.BaseService;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

@FeignClient(value = BaseService.appName,configuration = FeignAuthConfig.class)
public interface CusUserSignInService extends BaseService {

    /**
     * 用户签到的总天数
     * @param userId 用户ID
     * @return BigDecimal
     */
    @RequestMapping(contextPath + "/user/totalSignInNum")
    BigDecimal totalSignInNum(@RequestParam("userId") BigDecimal userId);

    /**
     * 保存签到
     * @param userSignIn
     * @return
     */
    @RequestMapping(contextPath + "/user/saveUserSignIn")
    Map<String,Object> saveUserSignIn(@RequestBody Map<String, Object> userSignIn);




    /**
     * 搜索签到列表
     * @param userSignIn
     * @return
     */
    @RequestMapping(contextPath + "/user/selectUserSignInList")
    List<Map<String,Object>> selectUserSignInList(@RequestBody Map<String, Object> userSignIn);


    /**
     * 验证用户当天是否签到过
     * @param userId 用户ID
     * @param signDate 签到时间
     * @return true签到过，false未签到过
     */
    @RequestMapping(contextPath + "/user/checkUserIsSign")
    boolean checkUserIsSign(@RequestParam("userId") BigDecimal userId,
                            @RequestParam("signDate") String signDate);

    /**
     * 用户Id搜索
     * @param userId
     * @return
     */
    @RequestMapping(contextPath + "/user/querySignInDateByUserId")
    List<Map<String,Object>> querySignInDateByUserId(@RequestParam("userId") BigDecimal userId);

    /**
     * 获取用户的某个月的签到记录
     * @param userId 用户ID
     * @param year 年
     * @param month 月
     * @return List<CusUserSignIn>
     */
    @RequestMapping(contextPath + "/user/findUserMonthSignList")
    List< Map<String,Object>> findUserMonthSignList(@RequestParam("userId") BigDecimal userId,
                                                    @RequestParam("year") String year,
                                                    @RequestParam("month") String month);
}
